package com;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class GameRuleTest {
	
	boolean [][] beforeMap = {{true,false,true,true},
			{false,false,true,true},
			{true,true,false,false},
			{true,true,true,true}};
	boolean [][] afterMap = {{false,true,true,true},
			{true,false,false,true},
			{true,false,false,false},
			{true,false,true,false}};
	GameRule gRule = new GameRule();
	GameMap gMap = new GameMap(4,4, beforeMap);
	
	
	@Before
	public void setUp() throws Exception {
		
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testUpdate() {

		gRule.update(gMap);
		
		for(int i=0;i<gMap.getRows();i++) {
            for(int j=0;j<gMap.getCols();j++) {
            	assertEquals(afterMap[i][j], gMap.get(i, j));
            }
		}
	}

}
